﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Library_MrDat
{
    class Delete_Path
    {
        public static string path1 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).ToString();
        public static string path2 = Path.GetPathRoot(Environment.SystemDirectory).ToString() + "Program Files";
        //public static string path2 = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86).ToString();
        //public static string drive = Path.GetPathRoot(Environment.SystemDirectory).ToString();

        private void button1_Click(object sender, EventArgs e)
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData).ToString() + @"\IObit\Advanced SystemCare V7\Log";
            System.IO.DirectoryInfo di = new DirectoryInfo(path);
            foreach (FileInfo file in di.GetFiles())
            {
                file.Delete(); 
            }
            foreach (DirectoryInfo dir in di.GetDirectories())
            {
                dir.Delete(true); //delete subdirectories and files
            }
        }
    }
}
